package day1124_3;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class Test1 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        //1.读取com.mysql.cj.jdbc.   Driver
        Class.forName("com.mysql.cj.jdbc.Driver");
        //2.getConnection 和mysql建立连接对象
        Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/big22_3?serverTimezone=GMT%2B8&useSSL=false","root","root");
        //Statement对象,   java执行一个sql
        Statement  stmt =conn.createStatement();//获取一个Statement();
        //执行sql
        stmt.execute("create database  big22_3");
        //操作
        conn.close();//关闭
    }


}


